package cn.kgc.vue.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName sys_log_info
 */
@TableName(value ="sys_log_info")
@Data
@ExcelTarget("logs")
public class LogInfo implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 操作人
     */
    @Excel(name = "操作人")
    private String username;

    /**
     * 用户ip   操作地点
     */
    @Excel(name = "用户ip")
    private String ip;

    /**
     * 参数
     */
    @Excel(name = "参数")
    private String params;

    /**
     * 资源路径
     */
    @Excel(name = "资源路径")
    private String url;

    /**
     * 操作描述
     */
    @Excel(name = "操作描述")
    private String description;

    /**
     * 创建时间
     */
    @Excel(name = "操作时间",exportFormat = "yyyy/MM/dd")
    private Date createTime;

    /**
     * 操作模块
     */
    @Excel(name = "操作模块")
    private String model;

    /**
     * 操作耗时
     */
    @Excel(name = "操作耗时")
    private Integer timeConsuming;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        LogInfo other = (LogInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
            && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp()))
            && (this.getParams() == null ? other.getParams() == null : this.getParams().equals(other.getParams()))
            && (this.getUrl() == null ? other.getUrl() == null : this.getUrl().equals(other.getUrl()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getModel() == null ? other.getModel() == null : this.getModel().equals(other.getModel()))
            && (this.getTimeConsuming() == null ? other.getTimeConsuming() == null : this.getTimeConsuming().equals(other.getTimeConsuming()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
        result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode());
        result = prime * result + ((getParams() == null) ? 0 : getParams().hashCode());
        result = prime * result + ((getUrl() == null) ? 0 : getUrl().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getModel() == null) ? 0 : getModel().hashCode());
        result = prime * result + ((getTimeConsuming() == null) ? 0 : getTimeConsuming().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", username=").append(username);
        sb.append(", ip=").append(ip);
        sb.append(", params=").append(params);
        sb.append(", url=").append(url);
        sb.append(", description=").append(description);
        sb.append(", createTime=").append(createTime);
        sb.append(", model=").append(model);
        sb.append(", timeConsuming=").append(timeConsuming);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}